![]() |
UniqueID |
||||
Header: | Resources.h | Carbon status: | Supported | |
Gets a unique resource ID for a resource.
SInt16 UniqueID ( ResType theType );
A resource type.
A resource ID greater than 0 that isn’t currently assigned to any resource of the specified type in any open resource fork.
You should use this function before adding a new resource to ensure that you don’t duplicate a resource ID and override an existing resource.
To check for errors, call the ResError function.
For more information about restrictions on resource IDs for specific resource types, see ResID.
In versions of system software earlier than System 7, this function may return a resource ID in the range 0 through 127, which is generally reserved for system resources. You should check that the resource ID returned is not in this range. If it is, call UniqueID again, and continue doing so until you get a resource ID greater than 127.
In System 7 and later versions, UniqueID won’t return a resource ID of less than 128.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)